/* eslint-disable max-lines */
import DataSelect from '@/components/DataSelect';
import TauSimpleSelect from '@/components/TauSimpleSelect';
import * as BASE from '@/stores/definitions-base';
import { t } from '@lingui/macro';
import dayjs from 'dayjs';
import React from 'react';

const {
  DATETIME_TEXT,
  DATE_TEXT,
  TIME_TEXT,
  EMPTY_TEXT,
  ENUMS: ENUMSBase,
  FieldsGrid: FieldGridBase,
  TitleGrid,
  column: columnBase,
  toSelectDataSource,
} = BASE;
export { DATETIME_TEXT, DATE_TEXT, EMPTY_TEXT, TIME_TEXT, TitleGrid, toSelectDataSource };

export function column(...args) {
  return columnBase(orderModel, ...args);
}

export function FieldsGrid(props) {
  return <FieldGridBase model={orderModel} {...props} />;
}

//----------------------------------------------------------------------
export const ENUMS = {
  ...ENUMSBase,
  orderType: {
    0: t`OPEN票`,
    1: t`普通票`,
    undefined: t`普通票`,
  },
};

export const orderModel = {
  id: {
    label: t`编号`,
  },
  content: {
    label: t`内容`,
  },
  price: {
    label: t`费用`,
  },
  difference: {
    label: t`差价`,
  },
  crDate: {
    label: t`创建时间`,
    text: DATETIME_TEXT,
  },
};

